<template>
    <div class="my-setting">
        <div class="setting-options">
            <mt-cell title="修改密码" to="/change_passwd" is-link class="person-cell"></mt-cell>
            <mt-cell title="我的收货地址" to="/my_address" is-link v-if="level == 1 || level == 2"></mt-cell>
        </div>
        <div class="my-logout" @click="logout">退出登录</div>
    </div>
</template>
<script>
export default {
    data() {
        return {
            level: ''
        }
    },
    methods: {
        logout() {
            localStorage.removeItem('dongHang_data')
            this.$router.push('/')
        }
    },
    mounted() {
        this.level = JSON.parse(window.localStorage.getItem('dongHang_data')).level
    }
}
</script>

<style lang="less" scoped>
.my-setting{
    // height: 3.36rem;
    background: #efefef;
    .setting-options {
        margin-top: 4px;
        padding-left: .3rem;
        margin-bottom: .2rem;
        background: #fff;
        .person-cell {
             border-bottom: 1px solid #cccccc;
        }
    }
    .my-logout{
        text-align: center;
        padding: .36rem;
        color: #ff2d41;
        font-size: .3rem;
        background: #fff;
        height: .32rem;
    }
}
</style>

